package com.technology.thread;

public class ThreadGroupUsing {

	public static void main(String[] args) {
		ThreadGroup group = new ThreadGroup("Group1");
		
		Thread thread1 = new Thread(group, "thread1"){
			@Override
			public void run(){
				System.out.println("Thread 1 is running now!");
				
			}
		};
		
		Thread thread2 = new Thread(group, "thread2"){
			@Override
			public void run(){
				System.out.println("Thread 2 is running now!");
			}
		};
		
		thread1.setDaemon(true);
		
		thread1.start();
		thread2.start();
		
		group.setMaxPriority(3);
		
		
		System.out.println(group.activeCount());
		
	}

}
